home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / strategy / vga_card.000 / vga_cardgames-1.3.1.tar / vga_cardgames / ohhell.h < prev    next >
C/C++ Source or Header  |  1994-06-25  |  2KB  |  77 lines

  1. /*
  2.  * Oh Hell!
  3.  *
  4.  * Copyright (C) Evan Harris, 1991, 1993, 1994
  5.  *
  6.  * Permission is granted to freely redistribute and modify this code,
  7.  * providing the author(s) get credit for having written it.
  8.  */
  9.  
  10. #include "common.h"
  11.  
  12.  
  13. #define NEXTGAME        -10
  14. #define CONTINUE        -11
  15.  
  16. #define SPADES            0
  17. #define CLUBS            1
  18. #define HEARTS            2
  19. #define DIAMONDS        3
  20.  
  21. #define NUMSUITS        4
  22. #define NUMPLAYERS        4
  23. #define NUMCARDS        52
  24. #define NUMHANDS        (NUMCARDS / NUMPLAYERS)
  25.  
  26. #define CARD(suit, type)    ((suit) * 13 + (type))
  27. #define SUIT(card)        (((card) % 52) / 13)
  28. #define TYPE(card)        ((card) % 13)
  29. #define ISCARD(card)        ((card) >= 0 && (card) < 104)
  30. #define ISBLACK(card)        (SUIT(card) == SPADES || SUIT(card) == CLUBS)
  31. #define ISRED(card)        (SUIT(card) == HEARTS || SUIT(card) == DIAMONDS)
  32. #define NOCARD            255
  33. #define NOSUIT            4
  34.  
  35. #define TYPECMP(a, b)        ((((a) + 12) % 13) > (((b) + 12) % 13) ? 1 : -1)
  36.  
  37. #define ACE            0
  38. #define TWO            1
  39. #define THREE            2
  40. #define FOUR            3
  41. #define FIVE            4
  42. #define SIX            5
  43. #define SEVEN            6
  44. #define EIGHT            7
  45. #define NINE            8
  46. #define TEN            9
  47. #define JACK            10
  48. #define QUEEN            11
  49. #define KING            12
  50.  
  51. extern unsigned char    hand[NUMPLAYERS][NUMHANDS];
  52.  
  53.  
  54. void InitGame(void);
  55. short PlayGame(unsigned char, unsigned char);
  56. unsigned char Deal(unsigned char);
  57. short GetBid(unsigned char, unsigned char, unsigned char);
  58. short GetPlay(unsigned char, unsigned char, unsigned char);
  59. int Cmp(unsigned char *, unsigned char *);
  60.  
  61. void InitDisplay(int, char **);
  62. void ShowPlay(unsigned char, unsigned char);
  63. void RemovePlays(void);
  64. void ShowHand(unsigned char *, unsigned char);
  65. void ShowWins(unsigned char *);
  66. void ShowBid(unsigned char, unsigned char);
  67. void RemoveBids(void);
  68. void ShowScores(unsigned char *);
  69. void ShowTrumps(unsigned char);
  70. void RemoveTrumps(void);
  71. short GetPlayerBid(unsigned char);
  72. short GetCmd(void);
  73. short WaitForKey(void);
  74. #if 0
  75. void FlushIn(void);
  76. #endif
  77.